function renderPic() {
  $.ajax({
    url: '/my/userinfo',
    success(res) {
      let first = res.data.username.substr(0, 1).toUpperCase()

      if (!res.data.user_pic) {
        $('.fir_img').text(first).show()
      } else {
        $('.layui-nav-img').attr('src', res.data.user_pic).show()
      }

      if (!res.data.nickname) {
        $('.username').text(res.data.username)
      } else {
        $('.username').text(res.data.nickname)
      }
    }
  })
}
renderPic()